package com.frank.oj.core.receiver;

/**
 * @author frank
 * @Date 2024/4/24
 */
public abstract class AbstractReceiver {

    /**
     * 获取等待队列中的任务
     */
    public void handleWaitingTask(String... queues) {
        for (String queue : queues) {
            String taskStr = getTaskByRedis(queue);
            if (taskStr != null) {
                handleJudgeMsg(taskStr, queue);
            }
        }
    }


    public abstract String getTaskByRedis(String queue);

    public abstract void handleJudgeMsg(String taskStr, String queueName);
}
